//
//  ByViewWithdrawInfo.m
//  chequanbao_ios
//
//  Created by mc on 2017/6/20.
//  Copyright © 2017年 com.itboye. All rights reserved.
//

#import "ByViewWithdrawInfo.h"

@interface ByViewWithdrawInfo()
@property (nonatomic, strong) NSArray *titleAry;
@end

@implementation ByViewWithdrawInfo

-(instancetype)initWithFrame:(CGRect)frame{
    if (self = [super initWithFrame:frame]) {
        self.backgroundColor = [UIColor clearColor];
        [self createView];
    }
    return self;
}

#pragma mark -- getter
-(NSArray *)titleAry{
    if (!_titleAry) {
        _titleAry = @[@"姓名",@"联系方式",@"提现金额",@"卡号",@"请输入省份",@"请输入市／县",@"收款账户开户网点"];
    }
    return _titleAry;
}

// 创建视图
- (void)createView{

    // 背景视图
    CGFloat x,y,width,height;
    for (int i = 0; i <self.titleAry.count; i ++) {
        x = 10;
        y = (50 + 10) * i;
        height = 50;
        width = SCREEN_WIDTH - 20;
        UIView *bgview = [[UIView alloc] initWithFrame:CGRectMake(x, y, width,height )];
        bgview.backgroundColor = [UIColor colorWithWhite:0.95 alpha:0.25];
        bgview.layer.cornerRadius = 4.0;
        bgview.tag = 100 + i;
        [self addSubview:bgview];
        // 标题
        UILabel *titleLabel = [[UILabel alloc] initWithFrame:CGRectMake(10, 10, [@"收款账户开户网点" getSizeOfString:14].width, 30)];
        titleLabel.font = FONT(14);
        titleLabel.textColor = [UIColor colorWithWhite:0.90 alpha:1];
        titleLabel.text = self.titleAry[i];
        [bgview addSubview:titleLabel];
        
        // 输入框
        UITextField *tf = [[UITextField alloc] initWithFrame:CGRectMake(titleLabel.right + 30, 10, bgview.width - (titleLabel.right + 30), 30)];
        tf.textColor = [UIColor whiteColor];
        tf.tag = 10 + i;
        [bgview addSubview:tf];
        
        if (i == 2) {
            tf.keyboardType = UIKeyboardTypeNumberPad;
        }
        
    }

    
}


@end
